<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>修改管理员</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script type="text/javascript" src="/asset/js/jquery-3.3.1.min.js"></script>
	<script src="/asset/layui/layui.js"></script>
    <script src="/asset/js/common.js"></script>
</head>
<body >
<div class="alert_bigbox">

	<form class="layui-form">
		 <input type="hidden" name="partyId" value="${party.partyId}">
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  手机号码
              </label>
              <div class="layui-input-inline layui-form-mid layui-word-aux">
                  ${party.userLoginId}
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  姓名
              </label>
              <div class="layui-input-inline layui-form-mid layui-word-aux">
                  ${party.person.name}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="gender" class="layui-form-label">
                  	性别
              </label>
              <div class="layui-input-inline layui-form-mid layui-word-aux">
				  
				  <@linkage type="GENDER" key=party.person.gender>
                    		<span class="${linkage.style}">${linkage.name}</span>
                    		</@linkage>
              </div>
          </div>
          <div class="layui-form-item">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-inline">
                	<select name="orgId">
				        <option value="">请选择机构</option>
				        <#list orgs as item>
				        <option value="${item.organizationId}" <#if org?? && org.organizationId == item.organizationId>selected</#if>>${item.name}</option>
				        </#list>
				     </select>
                </div>
              </div>
          <div class="layui-form-item">
              <label for="roleId" class="layui-form-label">
                  <span class="x-red">*</span>职位
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="position" name="position" value="${staff.position}" required="" lay-verify="position" autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="roleId" class="layui-form-label">
                  邮箱
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="email" name="email" value="${staff.email}" required="" lay-verify="position" autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="roleId" class="layui-form-label">
                 固话
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="telephone" name="telephone" value="${staff.telephone}" required="" lay-verify="position" autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="edit" lay-submit="">修改</button>
          </div>
      </form>

</div>

    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;
        
          //监听提交
          form.on('submit(edit)', function(data){
            
            $.ajax({
      			type:"POST", 
      			url:"/staff/modify.htm",
      			data:data.field ,
      			success:function(result) {
		      
		      		if(result.code=='1'){
		      			layer.alert("修改成功", {icon: 6},function () {
			                // 获得frame索引
			                
			                parent.document.getElementById('rightMain').contentWindow.location.reload(true);
			                var index = parent.layer.getFrameIndex(window.name);
			                //关闭当前frame
			                parent.layer.close(index);
			            });
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    }); 
            
            return false;
          });
          
        });
    </script>

</body>
</html>